package com.xsomnus.design_patterns.structors.decorator;

/**
 * @author 叶小夏
 * @since 2019-08-27 10:45
 */
public class Mocha extends Decorator {
    private final String desc = "加了摩卡";
    private Beverage beverage;

    public Mocha(Beverage beverage) {
        this.beverage = beverage;
    }

    public String getDescription() {
        return beverage.desc() + "\n" + desc;
    }

    public double getPrice() {
        return beverage.price() + 30;    //30表示摩卡的价格
    }


}
